define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Teambuy,$ionicSlideBoxDelegate) {
		$scope.selectTab = 0;
		$scope.activeTab = function(index) {
			$scope.selectTab = index;
			$ionicSlideBoxDelegate.$getByHandle('tab-handle').slide(index);
		};
		$scope.slideChanged = function(index) {
			$scope.selectTab = index;
		};

	}

	controller.$inject = ['$scope', 'Teambuy','$ionicSlideBoxDelegate'];
	
	return app.registerController("teambuyctrl",controller);
});